package com.csun.cmny.provider.dto;

import com.csun.cmny.provider.validator.OmcServiceAddValidator;
import com.csun.cmny.provider.validator.OmcServiceItemAddValidator;
import com.csun.cmny.provider.validator.OmcServiceItemEditValidator;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

@Data
public class ServiceItemDto implements Serializable {

    /**
     * ID
     */
    @NotNull(message = "{serviceItem.id.null}",
            groups = {OmcServiceItemEditValidator.class})
    private Long id;

    /*
    * 异常报告项
    */
    @Transient
    private List<ReportItemDto> reportItemDtos;

    /**
     * 服务id
     */
    @NotNull(message = "{serviceItem.serviceId.null}",
            groups = {OmcServiceItemAddValidator.class})
    @NotNull(message = "{serviceItem.serviceId.null}",
            groups = {OmcServiceItemEditValidator.class})
    private Long serviceId;

    /**
     * 流程顺序
     */
//    @NotNull(message = "{serviceItem.itemOrder.null}",
//            groups = {OmcServiceItemAddValidator.class})
//    @NotNull(message = "{serviceItem.itemOrder.null}",
//            groups = {OmcServiceItemEditValidator.class})
    private Integer itemOrder;

    /**
     * 服务项名称
     */
    private String itemName;

    /**
     * 服务项类型
     */
    @NotNull(message = "{serviceItem.itemType.null}",
            groups = {OmcServiceItemAddValidator.class})
    @NotNull(message = "{serviceItem.itemType.null}",
            groups = {OmcServiceItemEditValidator.class})
    @Range(min = 0, max = 1, message = "{serviceItem.itemType.range}",
            groups = {OmcServiceAddValidator.class})
    @Range(min = 0, max = 1, message = "{serviceItem.itemType.range}",
            groups = {OmcServiceItemEditValidator.class})
    private Integer itemType;

}
